<template>
    <div class="cnt">
        <table class="table table-bordered table-striped">
            <tr>
                <th><span>控件名称</span><span class="label label-important">*</span></th>
                <th></th>
            </tr>
            <tr>
                <td>
                    <input type="text" id="orgname" v-model="title" placeholder="必填项">
                </td>
                <td>
                </td>
            </tr>
            <tr>
                <th><span>&nbsp;&nbsp;&nbsp;&nbsp;长</span> </th>
                <th>
                </th>
            </tr>
            <tr>
                <td>
                    <input id="orgwidth" v-model="orgwidth" type="text" class="input-small span1" />
                    px
                </td>
                <td></td>
            </tr>
        </table>


        <div style="display: none" ref="preview">
            <img width="24" height="24" src="../img/paper-clip.png" :title="title" alt="" leipiplugins="annex" :orgwidth="orgwidth" />

        </div>
    </div>
</template>

<script>
    var component = {
        data(){
            return {
                title:"",
                orgwidth: 200
            }
        },
        created(){
            var node;
            if( UE.plugins.annex.editdom) {
                node = $( UE.plugins.annex.editdom);
                var t = this;
                $.each(node[0].attributes, function() {
                    if(this.specified) {
                        console.log(this.name, this.value)
                        Vue.set(t, this.name, this.value)
                        // t[this.name] = this.value;
                    }
                });
                // $(node)
            }
        }

    }
</script>